package ga.stopcriterias;

import ga.individuals.Individual;

import java.util.Collection;

public class GenerationStrategy implements StopStrategy {
	private int maxGen;
	public int currentGen = 1;
	
	public GenerationStrategy(int maxGen) {
		this.maxGen = maxGen;
	}
	
	@Override
	public boolean execute(Collection<Individual> population) {
		boolean condition = (currentGen > maxGen);
		this.currentGen++;
		return condition;
	}
}
